package problem.solution.case04;

import org.springframework.aop.support.AopUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class ControllerSolution04 {

    @Resource
    ASolution04 aSolution04;

    /**
     * 解决方案3：获取代理类(必须在启动类上设置@EnableAspectJAutoProxy(exposeProxy=true))
     */
    @RequestMapping(value = "/solution04",method = RequestMethod.GET)
    public void proxyClassTest(){
        boolean aopProxy1 = AopUtils.isAopProxy(aSolution04);
        System.out.println("proxyClassTest result = " + aopProxy1);
        aSolution04.save01(aSolution04);
    }
}
